<?php
/**
 * Created by PhpStorm.
 * User: yearnfar<207736107@qq.com>
 * Date: 2015/7/21 0021
 * Time: 下午 12:08
 */

namespace Yearnfar\Component\Image;

/**
 * Represents an Accept-* header.
 *
 * An accept header is compound with a list of items,
 * sorted by descending quality.
 *
 * @author Jean-François Simon <contact@jfsimon.fr>
 */
class Image
{

    public static function mkSign($imagePath)
    {
        if (filesize($imagePath) > 1024*1024*10) {
            throw exception("image too big!!!");
        }

        return md5(file_get_contents($imagePath));
    }

    public static function resize($img, $wid, $hei, $c, $dstpath)
    {
        (new ImageResize)->resizeimage($img, $wid, $hei, $c, $dstpath);
    }
}